##
##    This file is part of Metrix.
##
##    Metrix is free software: you can redistribute it and/or modify
##    it under the terms of the GNU General Public License as published by
##    the Free Software Foundation, either version 3 of the License, or
##    (at your option) any later version.
##
##    Metrix is distributed in the hope that it will be useful,
##    but WITHOUT ANY WARRANTY; without even the implied warranty of
##    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##    GNU General Public License for more details.
##
##    You should have received a copy of the GNU General Public License
##    along with Metrix.  If not, see <http://www.gnu.org/licenses/>.
##

class IncidentesController < ApplicationController

  layout "incidentes"
  active_scaffold :incidente do |config|
     config.label = "Incidentes"
     config.columns = [:id, :version, :descripcion,  :estado, :severidad, :tipo_incidente, :fecha_apertura,
						:creador, :fecha_asignacion, :asignado, :fecha_correccion, :fecha_cierre, :costo]
     config.list.columns = [:version, :id, :estado, :severidad, :tipo_incidente, :costo]
     config.list.sorting = {:version => :asc}

     config.columns[:version].label = "Producto / Versión"

     #para que muestre un dropdown menu en vez de un editbox :)
     config.columns[:version].ui_type = :select
     
     ## Para que se permita seleccionar a mas de un elemento (en una relacion has_and_belongs_to_many)
     config.columns[:creador].ui_type = :select
     config.columns[:asignado].ui_type = :select
#     config.columns[:creador].label = "Recurso creador"
#     config.columns[:asignado].label = "Recurso asignado"

	## Busqueda ajax
	config.actions.swap :search, :live_search

	## Castellano
	config.actions = [:show, :update, :delete, :create, :list, :live_search]
	config.show.link.label = 'Ver'
	config.update.link.label = 'Modificar'
	config.delete.link.label = 'Borrar'
	config.create.link.label = 'Crear'
	config.live_search.link.label = 'Buscar'
  end

end

